package Controllers;

import Models.*;
import java.util.ArrayList;
import java.util.Date;

/**
 * @author Erik
 */
public class SaleCTR {

    private SalesCollection sales;

    public SaleCTR()
    {
        this.sales = SalesCollection.getInstance();
    }

    public Sale addSale(Customer customer, Employee employee)
    {
        Sale sale = new Sale(customer, employee);
        this.sales.addSale(sale);
        return sale;
    }

    public ArrayList<Sale> findSale(double totalMin, double totalMax, Date startDate, Date endDate, Customer customer, Employee employee, boolean delivery, boolean delivered, boolean paid)
    {
        return this.sales.findSale(totalMin, totalMax, startDate, endDate, customer, employee, delivery, delivered, paid);
    }

    public Sale getSale(int id)
    {
       return this.sales.getSale(id);
    }

	public ArrayList<Sale> getAllSales()
	{
		return this.sales.getAllSales();
	}

    public void removeSale(Sale sale)
    {
       this.sales.removeSale(sale);
    }
}
